define([
  'dodo',
  './base-config'
], function (dodo, baseConfig) {
  'use strict';
  // package是数组需要单独处理，因为extend对数组是覆盖，
  // 但是实际是需要合并两个数组
  var mergedPackageProp = [{
    name: 'jquery-validate',
    main: 'jquery-validate-main-min',
    location: './plugins/jquery-validate'
  }].concat(baseConfig.packages || []);
  var prodConfig = dodo.extend(true, {}, baseConfig, {
    "paths": {
      // requirejs plugins
      "text": "./requirejs/plugins/text/2.0.15/js/text.min",
      "i18n": "./requirejs/plugins/i18n/2.0.6/i18n.min",
      "domReady": "./requirejs/plugins/domready/2.0.1/js/domReady.min",
      "css": "./requirejs/plugins/css/0.1.10/js/css.min",
      // *** libraries plugins ***
      "jquery": './plugins/jquery/1.12.4/js/jquery.min',
      "bootstrap3": './plugins/bootstrap/3.3.7/js/bootstrap.min',
      "adminlte": './plugins/adminlte/2.4.2/js/adminlte.min',
      "backbone": "./plugins/backbone/1.3.3/js/backbone-min",
      "backbone-mn": "./plugins/backbone.marionette/4.0.0/js/backbone.marionette",
      "backbone.radio": "./plugins/backbone.radio/2.0.0/js/backbone.radio",
      "backbone-localstorage": "./plugins/backbone.localstorage/1.1.16/js/backbone.localStorage.min",
      "underscore": "./plugins/underscore/1.9.1/js/underscore",
      "lodash": "./plugins/lodash/4.17.10/js/lodash.min",
      "lodash-core": "./plugins/lodash/4.17.10/js/core.min",
      "layer": "./plugins/layer/3.1.1/layer",

      // *** form plugins ***
      // AMD module plugins
      "bs-datetimepicker": "./plugins/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min",
      "bs-datepicker": "./plugins/bootstrap-datepicker/1.8.0/js/bootstrap-datepicker.min",
      "bs-switch": "./plugins/bootstrap-switch/3.3.4/js/bootstrap-switch.min",
      "select2": "./plugins/select2/4.0.5/js/select2.min",
      "laydate": "./plugins/laydate/5.0.9/js/laydate",
      // not AMD module plugins
      "bs-datepicker-zh": "./plugins/bootstrap-datepicker/1.8.0/locales/bootstrap-datepicker.zh-CN.min",
      "icheck": "./plugins/icheck/1.0.2/js/icheck.min",
      "bs-timepicker": "./plugins/bootstrap-timepicker/0.5.2/js/bootstrap-timepicker.min",
      "autosize": "./plugins/autosize/4.0.2/js/autosize.min",

      // *** common UI plugins ***
      "slimscroll": "./plugins/jquery-slimscroll/1.3.8/js/jquery.slimscroll.min",
      "fastclick": "./plugins/fastclick/1.3.8/fastclick",
      "jquery-loading-indicator": "./plugins/jquery-loading-indicator/3.3.1/js/jquery.loading-indicator.min",

      // *** common plugins ***
      "moment": "./plugins/moment/2.22.2/js/moment-with-locales.min",
      "js-logger": "./plugins/js-logger/1.4.0/js/logger.min",
      "js-cookie": "./plugins/js-cookie/2.2.0/js/js.cookie.min",
      "json5": "./plugins/json5/2.2.0/js/json5.min",
      "localforage": "./plugins/localforage/1.7.2/js/localforage.min",
      // dayjs
      "dayjs": "./plugins/dayjs/1.7.5/dayjs.min",
      "dayjs-zh": "./plugins/dayjs/1.7.5/locale/zh-cn",
      "dayjs-plugin-advancedFormat": "./plugins/dayjs/1.7.5/plugin/advancedFormat",
      "dayjs-plugin-buddhistEra": "./plugins/dayjs/1.7.5/plugin/buddhistEra",
      "dayjs-plugin-isBetween": "./plugins/dayjs/1.7.5/plugin/isBetween",
      "dayjs-plugin-isLeapYear": "./plugins/dayjs/1.7.5/plugin/isLeapYear",
      "dayjs-plugin-relativeTime": "./plugins/dayjs/1.7.5/plugin/relativeTime",
      "dayjs-plugin-weekOfYear": "./plugins/dayjs/1.7.5/plugin/weekOfYear",
      /*** bootstrap-table ***/
      "bs-table-zh": "./plugins/bootstrap-table/1.12.1/locale/bootstrap-table-zh-CN.min",
      "bs-table": "./plugins/bootstrap-table/1.12.1/js/bootstrap-table.min",
      "bs-table-treegrid": "./plugins/bootstrap-table/1.12.1/extensions/treegrid/bootstrap-table-treegrid.min",
      "bs-table-resizable": "./plugins/bootstrap-table/1.12.1/extensions/resizable/bootstrap-table-resizable.min",

      // *** ztree ***
      "ztree": "./plugins/ztree/3.5.33/js/jquery.ztree.core.min",
      "ztree-excheck": "./plugins/ztree/3.5.33/js/jquery.ztree.excheck.min",
      "ztree-exedit": "./plugins/ztree/3.5.33/js/jquery.ztree.exedit.min",
      "ztree-exhide": "./plugins/ztree/3.5.33/js/jquery.ztree.exhide.min",
      "ztree-all": "./plugins/ztree/3.5.33/js/jquery.ztree.all.min",
      //*** misc ***
      "fullscreen": "./plugins/fullscreen/1.2/js/jquery.fullscreen",
      "metismenu": "./plugins/metismenu/1.1.3/js/jquery.metisMenu",
      "pubsub": "./plugins/pubsubjs/1.5.8/js/pubsub.min",

      // *** tools ***
      "jquery-mockjax": "./plugins/jquery-mockjax/2.5.0/js/jquery.mockjax.min",
      "wang-editor": "./plugins/wang-editor/3.1.1/js/wangEditor.min",
      "art-template": "./plugins/art-template/4.13.1/js/template-web.min"
    },
    "shim": {
      "bootstrap3": {
        "deps": [
          "jquery"
        ]
      },
      "adminlte": {
        "deps": [
          "jquery",
          "css!./plugins/ionicons/2.0.0/css/ionicons.min",
          "css!./plugins/font-awesome/4.7.0/css/font-awesome.min"
        ]
      },
      "backbone": {
        // "deps": ["underscore", "jquery"],
        "exports": "Backbone"
      },
      "underscore": {
        "exports": "_"
      },
      "layer": {
        "deps": ["jquery"]
      },
      "slimscroll": {
        "deps": ["jquery"]
      },
      "jquery-loading-indicator": {
        "deps": [
          "jquery",
          "css!./plugins/jquery-loading-indicator/3.3.1/css/jquery.loading-indicator"
        ]
      },
      "icheck": {
        "deps": [
          "jquery",
          "css!./plugins/icheck/1.0.2/css/skins/flat/_all"
        ]
      },
      "bs-datepicker": {
        "deps": [
          "css!./plugins/bootstrap-datepicker/1.8.0/css/bootstrap-datepicker3.min"
        ]
      },
      "bs-datepicker-zh": {
        "deps": [
          "jquery",
          "bs-datepicker"
        ]
      },
      "bs-datetimepicker": {
        "deps": [
          // jquery, moment, bootstrap
          "css!./plugins/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min"
        ]
      },
      "bs-timepicker": {
        "deps": [
          "jquery",
          "css!./plugins/bootstrap-timepicker/0.5.2/css/bootstrap-timepicker.min"
        ]
      },
      "bs-switch": {
        "deps": [
          "css!./plugins/bootstrap-switch/3.3.4/css/bootstrap3/bootstrap-switch.min"
        ]
      },
      "bs-table": {
        "deps": [
          "jquery",
          "css!./plugins/bootstrap-table/1.12.1/css/bootstrap-table.min"
        ]
      },
      "bs-table-zh": {
        "deps": [
          "jquery",
          "bs-table"
        ]
      },
      "bs-table-treegrid": {
        "deps": [
          "jquery",
          "bs-table"
        ]
      },
      "bs-table-resizable": {
        "deps": [
          "jquery",
          "bs-table"
        ]
      },
      "ztree-all": {
        "deps": [
          "jquery",
          "css!./plugins/ztree/3.5.33/css/metroStyle/metroStyle"
        ]
      },
      "ztree": {
        "deps": [
          "jquery",
          "css!./plugins/ztree/3.5.33/css/metroStyle/metroStyle"
        ]
      },
      "ztree-excheck": {
        "deps": [
          "jquery",
          "ztree"
        ]
      },
      "ztree-exedit": {
        "deps": [
          "jquery",
          "ztree"
        ]
      },
      "ztree-exhide": {
        "deps": [
          "jquery",
          "ztree"
        ]
      },
      "select2": {
        "deps": [
          "jquery",
          "css!./plugins/select2/4.0.5/css/select2.min",
          "css!./plugins/select2/4.0.5/css/select2-bootstrap.min"
        ]
      },
      "wang-editor": {
        "deps": [
          "css!./plugins/wang-editor/3.1.1/css/wangEditor.min"
        ]
      },
      "fullscreen": {
        "deps": ["jquery"]
      },
      "metismenu": {
        "deps": [
          "jquery"
        ]
      }
    }
  });

  prodConfig.packages = mergedPackageProp;
  return prodConfig;
});

